package com.eastcom.groovy.tools.db;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.annotation.XmlRootElement;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@XmlRootElement
public class DbInfo {
	private String name;
	private Map<String, Table> tables;
	public DbInfo() {
		super();
		// TODO 自动生成的构造函数存根
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Map<String, Table> getTables() {
		return tables;
	}
	public void setTables(Map<String, Table> tables) {
		this.tables = tables;
	}
	public static void main(String[] args) throws JAXBException {
		JAXBContext ctx = JAXBContext.newInstance(DbInfo.class);
		Marshaller marchaller = ctx.createMarshaller();
		DbInfo dbInfo = new DbInfo();
		dbInfo.setName("a");
		List<Table> tables = new ArrayList<Table>();
		Table aTable = new Table();
		List<String> feild = new ArrayList<String>();
		feild.add("gggg");
		aTable.setFeildName(feild);
		tables.add(aTable);
		marchaller.marshal(dbInfo, System.out);
	}
	
}
